﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:Licenta3" xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	mc:Ignorable="d"
	x:Class="Anexa5View"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" Width="400" Height="650" Background="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Licenta3;component/Simple Styles.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<local:Anexa5ViewModel x:Key="Anexa5ViewModelDataSource" d:IsDataSource="True"/>
	</ResourceDictionary>
	</UserControl.Resources>
	<ScrollViewer VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
	<telerikDocking:ProportionalStackPanel Orientation="Vertical" DataContext="{Binding Source={StaticResource Anexa5ViewModelDataSource}}" Height="650">
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Încarcă anexa5.xml"/></TextBlock>
			<Grid>
				<TextBox TextWrapping="Wrap" Margin="4" IsReadOnly="True" Text="{Binding AnexaXMLSource, Mode=OneWay}"/>
				<Button Margin="0,4,4,4" HorizontalContentAlignment="Center" Style="{Binding Mode=OneWay, Source={StaticResource SimpleButton}}" Command="{Binding SelectFileDialogCommand}" VerticalAlignment="Center" HorizontalAlignment="Right">
					<Image Source="folder_Open_16xLG.png" HorizontalAlignment="Left"/>
				</Button>
			</Grid>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
			<Separator Margin="0"/>
			<Separator Margin="0"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Autorizat"/></TextBlock>
			<ComboBox Margin="4" ItemsSource="{Binding Setari.lAutorizat}" SelectedItem="{Binding Anexa.Autorizat}" SelectedValue="{Binding Anexa.Autorizat.Nume}" SelectedValuePath="Nume" DisplayMemberPath="Nume"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="OCPI"/></TextBlock>
			<ComboBox Margin="4" ItemsSource="{Binding Setari.lists.OCPI}" DisplayMemberPath="denumire" SelectedItem="{Binding Anexa.OCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.OCPI.denumire}" SelectedValuePath="denumire">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<i:InvokeCommandAction Command="{Binding UpdateUATImobilListCommand}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ComboBox>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="BCPI"/></TextBlock>
			<ComboBox Margin="4" SelectedItem="{Binding Anexa.BCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.BCPI.denumire}" ItemsSource="{Binding Anexa.OCPI.BCPI}" SelectedValuePath="denumire" DisplayMemberPath="denumire"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="UAT"/></TextBlock>
            <ComboBox Margin="4" ItemsSource="{Binding UATImobilList}" DisplayMemberPath="Denumire" SelectedItem="{Binding Anexa.Imobil.UAT, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.Imobil.UAT.Denumire}" SelectedValuePath="Denumire"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top" Margin="4">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Date despre proprietar"/></TextBlock>
			<Separator Margin="0"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Nume"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.Nume}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Adresă"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.adresa.adresaIntreaga}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Serie CI"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.SerieCI}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Nr. CI"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.NrCI}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="CNP"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.id}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Adresă Imobil"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.Imobil.Adresa.adresaIntreaga}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top" Margin="4">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Listă acte"/></TextBlock>
			<Separator Margin="0"/>
		</UniformGrid>
		<telerik:RadGridView ItemsSource="{Binding Anexa.Acte, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsFilteringAllowed="False" ShowGroupPanel="False" ShowInsertRow="True" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" Margin="4,4.182,4,-89.667">
			<telerik:StyleManager.Theme>
				<telerik:SummerTheme/>
			</telerik:StyleManager.Theme>
		</telerik:RadGridView>
		<UniformGrid Rows="1" Columns="4" Height="32" VerticalAlignment="Top" Margin="4">
			<Button Content="Imprimantă" Margin="4"   VerticalAlignment="Center" Command="{Binding GenerateAnexaOutCommand}" CommandParameter="{Binding Content, RelativeSource={RelativeSource Self}}"/>
			<Button Content=".XML" Margin="4" VerticalAlignment="Center" Command="{Binding ToXMLCommand}"/>
			<Button Content=".PDF" Margin="4" VerticalAlignment="Center" Command="{Binding GenerateAnexaOutCommand}" CommandParameter="{Binding Content, RelativeSource={RelativeSource Self}}"/>
			<Button Content="Word" Margin="4" VerticalAlignment="Center" Command="{Binding GenerateAnexaOutCommand}" CommandParameter="{Binding Content, RelativeSource={RelativeSource Self}}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4">
			<Button Content="Resetează" Margin="4" Command="{Binding ResetModelCommand}"/>
		</UniformGrid>
	</telerikDocking:ProportionalStackPanel>
	</ScrollViewer>
</UserControl>